home *** CD-ROM | disk | FTP | other *** search
/ Especial Multimedia / Especial Multimedia.iso / Multimed / Prg / KALENDAR.ZIP / TEST4.FRM < prev    next >
Text File  |  1997-09-14  |  7KB  |  247 lines

  1. VERSION 2.00
  2. Begin Form Form4 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Moon BitBlt"
  5.    ClientHeight    =   4635
  6.    ClientLeft      =   3210
  7.    ClientTop       =   630
  8.    ClientWidth     =   7710
  9.    Height          =   5325
  10.    Left            =   3150
  11.    LinkTopic       =   "Form4"
  12.    ScaleHeight     =   4635
  13.    ScaleWidth      =   7710
  14.    Top             =   0
  15.    Width           =   7830
  16.    Begin Kalendar Kalendar1 
  17.       ArrowDelay      =   500
  18.       BackColor       =   &H00FFFFFF&
  19.       CalendarFormat  =   0  'Month
  20.       ChgOnOtherMon   =   -1  'True
  21.       DateDispStyle   =   2  'User
  22.       DayAlignment    =   0  'Upper Left
  23.       DOWAlign        =   2  'Center
  24.       DOWBackColor    =   &H00FFFFFF&
  25.       DOWBorder       =   0   'False
  26.       DOWDispStyle    =   2  'Medium
  27.       DOWFontBold     =   0   'False
  28.       DOWFontItalic   =   0   'False
  29.       DOWFontName     =   "Times New Roman"
  30.       DOWFontSize     =   12
  31.       DOWFontStrikeThru=   0   'False
  32.       DOWFontUnderline=   0   'False
  33.       DOWForeColor    =   &H00000000&
  34.       EnableKeys      =   -1  'True
  35.       FirstDOW        =   0  'Sunday
  36.       FixedDayHeight  =   0   'False
  37.       FontBold        =   0   'False
  38.       FontItalic      =   0   'False
  39.       FontName        =   "Times New Roman"
  40.       FontSize        =   12
  41.       FontStrikethru  =   0   'False
  42.       FontUnderline   =   0   'False
  43.       ForeColor       =   &H00000000&
  44.       Height          =   4650
  45.       Language        =   0  'English
  46.       Left            =   0
  47.       LineColor       =   &H00000000&
  48.       MonAlign        =   0  'Left
  49.       MonBackColor    =   &H00FFFFFF&
  50.       MonDispStyle    =   2  'Month/Year
  51.       MonFontBold     =   -1  'True
  52.       MonFontItalic   =   0   'False
  53.       MonFontName     =   "Arial"
  54.       MonFontSize     =   18
  55.       MonFontStrikeThru=   0   'False
  56.       MonFontUnderline=   0   'False
  57.       MonForeColor    =   &H00000000&
  58.       OtherMonBackColor=   &H00C0C0C0&
  59.       OtherMonForeColor=   &H00FFFFFF&
  60.       SelDayBackColor =   &H00C0C0C0&
  61.       SelDayForeColor =   &H00000000&
  62.       ShowAllDays     =   0   'False
  63.       ShowArrows      =   -1  'True
  64.       ShowLines       =   -1  'True
  65.       ShowSelection   =   -1  'True
  66.       TabIndex        =   8
  67.       Text            =   "07/04/94"
  68.       TextFormat      =   0  'mdy
  69.       Top             =   -15
  70.       Width           =   6390
  71.    End
  72.    Begin PictureBox Picture1 
  73.       AutoRedraw      =   -1  'True
  74.       BorderStyle     =   0  'None
  75.       Height          =   510
  76.       Index           =   7
  77.       Left            =   6735
  78.       Picture         =   TEST4.FRX:0000
  79.       ScaleHeight     =   510
  80.       ScaleWidth      =   510
  81.       TabIndex        =   7
  82.       Top             =   4185
  83.       Width           =   510
  84.    End
  85.    Begin PictureBox Picture1 
  86.       AutoRedraw      =   -1  'True
  87.       BorderStyle     =   0  'None
  88.       Height          =   510
  89.       Index           =   6
  90.       Left            =   6735
  91.       Picture         =   TEST4.FRX:0302
  92.       ScaleHeight     =   510
  93.       ScaleWidth      =   510
  94.       TabIndex        =   6
  95.       Top             =   3600
  96.       Width           =   510
  97.    End
  98.    Begin PictureBox Picture1 
  99.       AutoRedraw      =   -1  'True
  100.       BorderStyle     =   0  'None
  101.       Height          =   510
  102.       Index           =   5
  103.       Left            =   6735
  104.       Picture         =   TEST4.FRX:0604
  105.       ScaleHeight     =   510
  106.       ScaleWidth      =   510
  107.       TabIndex        =   5
  108.       Top             =   2985
  109.       Width           =   510
  110.    End
  111.    Begin PictureBox Picture1 
  112.       AutoRedraw      =   -1  'True
  113.       BorderStyle     =   0  'None
  114.       Height          =   510
  115.       Index           =   4
  116.       Left            =   6735
  117.       Picture         =   TEST4.FRX:0906
  118.       ScaleHeight     =   510
  119.       ScaleWidth      =   510
  120.       TabIndex        =   4
  121.       Top             =   2415
  122.       Width           =   510
  123.    End
  124.    Begin PictureBox Picture1 
  125.       AutoRedraw      =   -1  'True
  126.       BorderStyle     =   0  'None
  127.       Height          =   510
  128.       Index           =   3
  129.       Left            =   6735
  130.       Picture         =   TEST4.FRX:0C08
  131.       ScaleHeight     =   510
  132.       ScaleWidth      =   510
  133.       TabIndex        =   3
  134.       Top             =   1785
  135.       Width           =   510
  136.    End
  137.    Begin PictureBox Picture1 
  138.       AutoRedraw      =   -1  'True
  139.       BorderStyle     =   0  'None
  140.       Height          =   510
  141.       Index           =   2
  142.       Left            =   6735
  143.       Picture         =   TEST4.FRX:0F0A
  144.       ScaleHeight     =   510
  145.       ScaleWidth      =   510
  146.       TabIndex        =   2
  147.       Top             =   1185
  148.       Width           =   510
  149.    End
  150.    Begin PictureBox Picture1 
  151.       AutoRedraw      =   -1  'True
  152.       BorderStyle     =   0  'None
  153.       Height          =   510
  154.       Index           =   1
  155.       Left            =   6735
  156.       Picture         =   TEST4.FRX:120C
  157.       ScaleHeight     =   510
  158.       ScaleWidth      =   510
  159.       TabIndex        =   1
  160.       Top             =   615
  161.       Width           =   510
  162.    End
  163.    Begin PictureBox Picture1 
  164.       AutoRedraw      =   -1  'True
  165.       BorderStyle     =   0  'None
  166.       Height          =   510
  167.       Index           =   0
  168.       Left            =   6735
  169.       Picture         =   TEST4.FRX:150E
  170.       ScaleHeight     =   510
  171.       ScaleWidth      =   510
  172.       TabIndex        =   0
  173.       Top             =   0
  174.       Width           =   510
  175.    End
  176.    Begin Menu mnuFile 
  177.       Caption         =   "&File"
  178.       Begin Menu mnuFPrint 
  179.          Caption         =   "&Print"
  180.       End
  181.    End
  182. End
  183. Option Explicit
  184.  
  185. Sub Form_Activate ()
  186.     SetDescription Sample4Description()
  187. End Sub
  188.  
  189. Sub Form_Load ()
  190.     Kalendar1.Text = Date
  191. End Sub
  192.  
  193. Sub Form_Resize ()
  194.     Kalendar1.Move 0, 0, Form4.ScaleWidth, Form4.ScaleHeight
  195.     
  196. End Sub
  197.  
  198. Sub Kalendar1_DrawOnDay (hDC As Integer, STATE As Integer, theDay As Long, x As Single, y As Single, x2 As Single, y2 As Single)
  199. Dim retval As Integer
  200. Dim xr As Rect
  201. Dim w As Long
  202.     KalDrawBitmap hDC, Picture1(theDay Mod 8), x, y, x2, y2, 8, SRCAND
  203.  
  204.     If theDay < Date Then
  205.         KalWindowAPIRect x, y, x2, y2, xr
  206.         InflateRect xr, -1, -1
  207.         
  208.         w = MoveTo(hDC, xr.left, xr.top)
  209.         retval = LineTo(hDC, xr.right, xr.bottom)
  210.         w = MoveTo(hDC, xr.right, xr.top)
  211.         retval = LineTo(hDC, xr.left, xr.bottom)
  212.     End If
  213.  
  214. End Sub
  215.  
  216. Sub Kalendar1_QueryChangeDay (theDay As Long, Cancel As Integer)
  217.  
  218.     If theDay < Date Then
  219.         Beep
  220.         Cancel = True
  221.     End If
  222. End Sub
  223.  
  224. Sub mnuFPrint_Click ()
  225. Dim saveBackColor As Long
  226.  
  227.     saveBackColor = Kalendar1.MonBackColor
  228.     
  229.     Kalendar1.MonBackColor = RGB(255, 255, 255)
  230.     Kalendar1.PrintHDC = Printer.hDC
  231.     Kalendar1.PrintAction = KAL_PRINT_LANDSCAPE
  232.     
  233.     Kalendar1.MonBackColor = saveBackColor
  234.     
  235.     Printer.EndDoc
  236.  
  237. End Sub
  238.  
  239. Function Sample4Description () As String
  240. Dim s As String
  241.     s = "This is another of the DrawOnDay event. The moons are drawn by using the API call BitBlt and seven different picture boxes." & CR
  242.     s = s & "Also shown is a use of the QueryChangeDay event. You cannot access dates previous to today."
  243.  
  244.     Sample4Description = s
  245. End Function
  246.  
  247.